Public Class FormSplash
    Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents pbSplash As System.Windows.Forms.ProgressBar
    Friend WithEvents lblSplash As System.Windows.Forms.Label
    Friend WithEvents tmrSplash As System.Windows.Forms.Timer
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FormSplash))
        Me.pbSplash = New System.Windows.Forms.ProgressBar
        Me.lblSplash = New System.Windows.Forms.Label
        Me.tmrSplash = New System.Windows.Forms.Timer(Me.components)
        Me.PictureBox1 = New System.Windows.Forms.PictureBox
        Me.SuspendLayout()
        '
        'pbSplash
        '
        Me.pbSplash.Location = New System.Drawing.Point(8, 224)
        Me.pbSplash.Name = "pbSplash"
        Me.pbSplash.Size = New System.Drawing.Size(512, 8)
        Me.pbSplash.TabIndex = 0
        '
        'lblSplash
        '
        Me.lblSplash.Location = New System.Drawing.Point(8, 208)
        Me.lblSplash.Name = "lblSplash"
        Me.lblSplash.Size = New System.Drawing.Size(312, 16)
        Me.lblSplash.TabIndex = 1
        Me.lblSplash.Text = "Initializing STIMPy!..."
        '
        'tmrSplash
        '
        Me.tmrSplash.Interval = 125
        '
        'PictureBox1
        '
        Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
        Me.PictureBox1.Location = New System.Drawing.Point(0, 0)
        Me.PictureBox1.Name = "PictureBox1"
        Me.PictureBox1.Size = New System.Drawing.Size(533, 200)
        Me.PictureBox1.TabIndex = 2
        Me.PictureBox1.TabStop = False
        '
        'FormSplash
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(533, 240)
        Me.ControlBox = False
        Me.Controls.Add(Me.PictureBox1)
        Me.Controls.Add(Me.lblSplash)
        Me.Controls.Add(Me.pbSplash)
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "FormSplash"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "frmSplash"
        Me.ResumeLayout(False)

    End Sub

#End Region
    'Private thdSplash As New System.Threading.Thread(AddressOf setApp)
    Private iTmrCounter As Int32
    'Public tmrSplash As Timer = New Timer
    Public Sub changeStatus(ByVal message As String)
        Me.pbSplash.Value += 20
        Me.lblSplash.Text = message
        'Dim dlg As New oneString(AddressOf updateUI)
        'Dim args() As Object = {message}
        'Me.Invoke(dlg, args)
        'Me.pbSplash.Value += 20
        'Me.lblSplash.Text = message
    End Sub
    Private Delegate Sub oneString(ByVal msg As String)
    Private Sub updateUI(ByVal msg As String)
        Me.pbSplash.Value += 20
        Me.lblSplash.Text = msg
    End Sub
    Public Sub InfoLoaded()
        'frmList.Opacity = 0.0
        'frmList.Visible = True
        'frmList.Show()
        'Application.DoEvents()
        'Application.DoEvents()
        'tmrSplash.Start()
    End Sub

    Private Sub tmrSplash_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrSplash.Tick
        'Debug.WriteLine("The Timer has ticked!")
        If iTmrCounter < 20 Then
            iTmrCounter += 1
        ElseIf Not Me.Opacity < 0.05 Then
            Me.Opacity -= 0.05
            frmMain.Opacity += 0.05
        Else
            frmMain.Opacity = 1
            Me.Close()
        End If
        iTmrCounter += 1
    End Sub

    'Private Sub setApp()
    '    App = New clsApp(VERSION, Me)
    'End Sub

    'Private Sub frmSplash_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
    '    thdSplash.Start()
    'End Sub

    'Private Sub Label2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
    '    tmrSplash.Enabled = True
    'End Sub

    Private Sub FormSplash_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
        Me.lblSplash.Show()
        'Me.Label2.Show()
    End Sub

    Private Sub FormSplash_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class
